<template>
  <img alt="Vue logo" src="./assets/logo.png" />
  <HelloWorld :msg="msg" @changeValue="changeValue" />
</template>



<script setup lang="ts">

import HelloWorld from '@/components/HelloWorld.vue'

import { reactive,defineExpose  } from 'vue';

const msg = reactive({
  name: 'jack',
  age: 18
})



const changeValue = () => {
  console.log('更新 age 的值');
  msg.age = Math.random();
}

defineExpose({
  msg,
})

</script>


<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
</style>
